# # 1.打印水仙花数
# n = 3  # 水仙花数的位数
# while n < 6:  # 假设最大为5位数
#     for i in range(10 ** (n - 1), 10 ** n):
#         num_str = str(i)
#         sum_of_digits = sum([int(digit) ** n for digit in num_str])
#         if sum_of_digits == i:
#             print(i)
#     n += 1
# # 2.打印5行4列*
# rows = 5
# columns = 4
#
# for i in range(rows):
#     for j in range(columns):
#         print("*", end=" ")
#     print()  # 换行

# 3.打印直角三角形
"""
*
**
***
****
*****
"""
rows = 5

for i in range(1, rows + 1):
    for j in range(i):
        print("*", end="")
    print()
